package com.sale.table.controller;

import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;
import com.sale.table.domain.dto.SaleOrderTraceDto;
import com.sale.table.domain.dto.SalesCollectionDto;
import com.sale.table.domain.dto.SalesRankingDto;
import com.sale.table.domain.dto.SalesTotalDto;
import com.sale.table.domain.vo.SaleOrderTraceVo;
import com.sale.table.domain.vo.SalesTotalVo;
import com.sale.table.service.SaleOrderStatisticsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 销售统计报表 控制层
 */
@RestController
@RequestMapping("/sale-order-stat")
public class SaleOrderStatisticsController {

    @Resource
    SaleOrderStatisticsService saleOrderStatisticsService;

    /**
     * 销售订单跟踪 列表
     */
    @GetMapping("/saleOrderTrace")
    public TableDataInfo<SaleOrderTraceDto> saleOrderTrace(SaleOrderTraceVo saleOrderTraceVo, PageQuery pageQuery) {
        return saleOrderStatisticsService.getSaleOrderTraceList(saleOrderTraceVo,pageQuery);
    }

    /**
     * 销售收款一览表列表
     */
    @GetMapping("/salesCollectionList")
    public TableDataInfo<SalesCollectionDto> salesCollectionList(SaleOrderTraceVo saleOrderTraceVo, PageQuery pageQuery) {
        return saleOrderStatisticsService.getSalesCollectionList(saleOrderTraceVo,pageQuery);
    }

    /**
     * 销售汇总表
     */
    @GetMapping("/salesTotalList")
    public TableDataInfo<SalesTotalDto> salesTotalList(SalesTotalVo salesTotalVo, PageQuery pageQuery) throws Exception {
        return saleOrderStatisticsService.getSalesTotalList(salesTotalVo,pageQuery);
    }

    /**
     * 销售排行表
     */
    @GetMapping("/salesRankingList")
    public TableDataInfo<SalesRankingDto> salesRankingList(SalesTotalVo salesTotalVo, PageQuery pageQuery) throws Exception {
        return saleOrderStatisticsService.salesRankingList(salesTotalVo,pageQuery);
    }

}
